#include <bits/stdc++.h>
using namespace std;

int cnt[100005];

int main() {
    freopen("duel.in", "r", stdin);
    freopen("duel.out", "w", stdout);
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);

    int n,r,num_mi,ans;
    cin >> n;
    ans = n;
    for(int i = 0;i < n;i++) {
        cin >> r;
        cnt[r]++;
    }
    bool t = true;
    for(int j = 1;j <= 100005;j++) {
        if(cnt[j] > 0) {
            if(t) {
                num_mi = cnt[j];
                t = false;
            }
            else {
                if(cnt[j] > num_mi) {
                    ans -= num_mi;
                    num_mi = cnt[j];
                }
                else {
                    ans -= cnt[j];
                }
            }
        }
    }
    cout << ans << endl;
    return 0;
}
